package com.liushuang.service;

import com.liushuang.dao.UserRepository;
import com.liushuang.po.User;
import com.liushuang.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liushuang
 * @create 2020-10-03-19:38
 * description:
 */

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Util.code(password));

        return user;
    }
}
